-
Notifications
You must be signed in to change notification settings - Fork 288
Update db terminologies in blogs #2206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Website (appwrite/website)Project ID: Tip Each function runs in its own isolated container with custom environment variables |
|
@ebenezerdon I was looking through #2134 and looks like we have a different syntax for the row operations via the Tables API, so we may need to update all technical examples (particularly, to use the Tables object instead of the Databases object). |
Oh thanks. Let me check with Darshan |
|
The preview deployment failed. 🔴 Last updated at: 2025-08-20 18:54:55 CET |
WalkthroughThis PR systematically migrates website content and embedded code samples from Appwrite's Databases model (collections/documents/attributes) to the TablesDB model (tables/rows/columns). Changes include imports and instantiations (Databases → TablesDB), method renames and signature adjustments (e.g., listDocuments/createDocument → listRows/createRow, Functions.createExecution object → positional args), response shape updates (documents → rows), environment/constant renames (COLLECTION_ID → TABLE_ID), realtime channel renames, and multiple public export/constant renames (e.g., databases → tablesDB). Several Go examples and appwrite client modules were updated; one new auth store module was added. Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Areas to focus review on:
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 44
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (32)
src/routes/blog/post/product-update-jan-2025/+page.markdoc (2)
44-46: Section heading is incorrect (duplicate of previous section).This header says “The Appwrite Partners program” again, but the section content and image are about the Scale plan.
-# The Appwrite Partners program +# The Appwrite Scale plan
56-56: Fix typo in alt text: “Notfications” → “Notifications”.User-facing copy and accessibility text should be error-free.
- +src/routes/blog/post/open-source-firebase-alternative/+page.markdoc (1)
61-77: Correct Storage descriptions to remove “rows”
Storage should reference files only, not database rows.
- src/routes/blog/post/open-source-firebase-alternative/+page.markdoc (line 63): change “images, videos, rows, and other project files” → “images, videos, and other project files”
- src/routes/docs/products/storage/+page.markdoc (line 8): change “images, videos, rows, and other files” → “images, videos, and other files”
src/routes/blog/post/cors-error/+page.markdoc (1)
41-45: Fix inconsistency: “Bad ID on request” vs “Incorrect ID on request”The list entry (Line 43) doesn’t match the section heading. Unify to avoid confusion.
-3. Bad ID on request +3. Incorrect ID on requestAlso applies to: 63-64
src/routes/blog/post/open-source-vercel-alternative/+page.markdoc (1)
220-220: Broken docs path: “/doc/” → “/docs/”.This link likely 404s; fix before publishing.
-- [Appwrite Sites docs](/doc/products/sites) +- [Appwrite Sites docs](/docs/products/sites)src/routes/blog/post/improve-devex-dev-keys/+page.markdoc (1)
36-41: Table permissions currently block row creation. Set “Any → Create: True” for this demo.With all “Any” permissions set to False, unauthenticated clients cannot create rows; you’ll see 401/403 instead of 429. For this rate‑limit demo, allow table‑level Create.
| | Create | Read | Update | Delete | | --- | --- | --- | --- | --- | -| Any | False | False | False | False | +| Any | True | False | False | False |Docs: Users must be granted Create at the table level to create rows. (appwrite.io)
src/routes/blog/post/offline-first-journal/+page.markdoc (3)
193-216: Replace non-existent db.addTables with db.addCollections; fix misleading comment.RxDB exposes addCollections, not addTables. Local DB name doesn’t need to match the Appwrite database ID. (rxdb.info)
- // Add tables - await db.addTables({ - entries: { // Name must match the table ID from Appwrite + // Add collections + await db.addCollections({ + entries: { // Local collection name (can differ from Appwrite table ID) schema: journalSchema } });Also adjust the database name comment:
- name: 'journals', // Name must match the database ID from Appwrite + name: 'journals', // Local DB name (does not have to match the Appwrite database ID)
326-326: Fix import path: file is created as lib/databases.js, but imports use “database”.This will 404 at runtime. Unify to lib/databases.js.
-import { getJournals } from '$lib/database'; +import { getJournals } from '$lib/databases.js';-import { getJournals, deleteJournal } from '$lib/database.js'; +import { getJournals, deleteJournal } from '$lib/databases.js';-import { deleteJournal, getJournal } from '$lib/database.js'; +import { deleteJournal, getJournal } from '$lib/databases.js';-import { updateJournal, getJournal } from '$lib/database.js'; +import { updateJournal, getJournal } from '$lib/databases.js';-import { createJournal } from '$lib/database.js'; +import { createJournal } from '$lib/databases.js';Also applies to: 349-349, 438-438, 531-531, 654-654
355-363: Undefined function loadJournals() used after delete.Define it to refresh state after deletions.
async function handleDelete(id) { if (confirm('Are you sure you want to delete this journal entry?')) { try { await deleteJournal(id); await loadJournals(); } catch (err) { error = err.message; } } } function formatDate(timestamp) { return new Date(timestamp).toLocaleString(); } + + async function loadJournals() { + try { + journals = await getJournals(); + } catch (err) { + error = err.message; + } + }src/routes/blog/post/product-update-september/+page.markdoc (1)
28-28: Fix typo in link text."annoucement" → "announcement".
-[Read the annoucement.](https://appwrite.io/blog/post/announcing-roles-for-enhanced-collaboration-and-security) +[Read the announcement.](https://appwrite.io/blog/post/announcing-roles-for-enhanced-collaboration-and-security)src/routes/blog/post/customer-stories-smartbee/+page.markdoc (1)
4-4: Fix country name in description.Should be “Colombia,” not “Columbia.”
-description: Learn how Smartbee leveraged Appwrite to build a performant and robust system to monitor and aggregate gas level data in real-time for 7 coal mines in Columbia. +description: Learn how Smartbee leveraged Appwrite to build a performant and robust system to monitor and aggregate gas level data in real-time for 7 coal mines in Colombia.src/routes/blog/post/announcing-go-support/+page.markdoc (1)
250-270: Fix missing comma in error return; ListRows signature confirmed.- return Context.Res.Text("Internal error" Context.Res.WithStatusCode(500)) + return Context.Res.Text("Internal error", Context.Res.WithStatusCode(500))ListRows is defined as
func (srv *TablesDB) ListRows(databaseId string, tableId string, optionalSetters ...ListRowsOption) (*models.RowList, error)so calling
tablesDB.ListRows("main", "profiles")is correct—no params struct needed.src/routes/blog/post/appwrite-1.5-now-available-on-cloud/+page.markdoc (1)
221-231: Fix syntax error and switch to object-arg formThere’s an extra closing brace (“}”) and the example should use the queries array.
-db.listRows( - '<DATABASE_ID>', - '<TABLE_ID>', - [ - Query.or([ - Query.contains('name','ivy'), - Query.greaterThan('age',30) - ]) - ] -}); +tablesDB.listRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [ + Query.or([ + Query.contains('name', ['ivy']), + Query.greaterThan('age', 30), + ]), + ], +});src/routes/blog/post/simplify-your-data-management-with-relationships/+page.markdoc (1)
85-93: JSON syntax error: missing comma after $tableId{ "$id": "642b9d627d866e646602", "$databaseId": "marvel", - "$tableId": "reviews" + "$tableId": "reviews", "$createdAt": "2023-04-04T03:45:38.514+00:00", "$updatedAt": "2023-04-04T03:45:38.514+00:00", "$permissions": [], "content": "Great movie" }src/routes/blog/post/ci-cd-examples-in-appwrite/+page.markdoc (1)
41-47: YAML indentation: replace tabs with spacesTabs can break GitHub Actions parsing. Use spaces.
-name: Sync Tables - -on: - release: - types: [ published ] +name: Sync Tables + +on: + release: + types: [published]src/routes/blog/post/how-to-optimize-your-appwrite-project/+page.markdoc (1)
44-63: Fix stray brace and use object-arg listRows for paginationThere’s an unmatched “}” and the examples should use the object form.
-const firstPage = await tablesDB.listRows( - '<DATABASE_ID>', - '<TABLE_ID>', - [ - Query.equal('author', 'Meredith Palmer'), - Query.limit(20), - Query.offset(0),// Fetch the first 20 records - ] -}) - -const secondPage = await tablesDB.listRows( - '<DATABASE_ID>', - '<TABLE_ID>', - [ - Query.equal('author', 'Meredith Palmer'), - Query.limit(20), - Query.offset(20), // Fetch the next 20 records - ] -}) +const firstPage = await tablesDB.listRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [Query.equal('author', ['Meredith Palmer']), Query.limit(20), Query.offset(0)], +}); + +const secondPage = await tablesDB.listRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [Query.equal('author', ['Meredith Palmer']), Query.limit(20), Query.offset(20)], +});src/routes/blog/post/announcing-auto-increment-support/+page.markdoc (1)
52-59: Fix stray closing brace in code sample.The extra
}afterlistRows(...)breaks the snippet.tablesDB.listRows( '<DATABASE_ID>', '<TABLE_ID>', [ Query.orderAsc('$sequence'), ] -}); +);src/routes/blog/post/announcing-bulk-api/+page.markdoc (1)
55-71: Node example should use object-arg shape, not positional.
node-appwritemethods accept a single object. The current snippet will mislead users.-const result = await tablesDB.createRows( - '<DATABASE_ID>', - '<TABLE_ID>', - [ - { - $id: sdk.ID.unique(), - name: 'Row 1', - }, - { - $id: sdk.ID.unique(), - name: 'Row 2', - } - ] -); +const result = await tablesDB.createRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + rows: [ + { $id: sdk.ID.unique(), name: 'Row 1' }, + { $id: sdk.ID.unique(), name: 'Row 2' }, + ], +});src/routes/blog/post/3-things-you-can-build-with-go-runtime/+page.markdoc (2)
221-246: Handle errors from create operations (DB/Table/Column).Silent failures make debugging hard and can break example flows.
- dbs.Create( + if _, err := dbs.Create( dbId, "URL Database", - ) + ); err != nil { + Context.Error(err) + return + } @@ - dbs.CreateTable( + if _, err := dbs.CreateTable( dbId, tableId, "URLs", dbs.WithCreateTablePermissions([]string{permission.Read("any")}), - ) + ); err != nil { + Context.Error(err) + return + } @@ - dbs.CreateUrlColumn( + if _, err := dbs.CreateUrlColumn( dbId, tableId, "longUrl", true, dbs.WithCreateUrlColumnArray(false), - ) + ); err != nil { + Context.Error(err) + return + }
273-279: Guard missing dynamic API key.Accessing
Context.Req.Headers["x-appwrite-key"]without validation can lead to an empty key and 401s later. Fail fast with a clear message.client := appwrite.NewClient( appwrite.WithEndpoint(os.Getenv("APPWRITE_FUNCTION_API_ENDPOINT")), appwrite.WithProject(os.Getenv("APPWRITE_FUNCTION_PROJECT_ID")), - appwrite.WithKey(Context.Req.Headers["x-appwrite-key"]), + // Prefer dynamic API Key header; return 401 if missing + appwrite.WithKey(func() string { + key := Context.Req.Headers["x-appwrite-key"] + return key + }()), ) +if Context.Req.Headers["x-appwrite-key"] == "" { + return Context.Res.Json(map[string]any{ + "ok": false, + "error": "Missing x-appwrite-key (dynamic API key). Enable it in Function Settings and pass it in the request.", + }, Context.Res.WithStatusCode(401)) +}src/routes/blog/post/announcing-atomic-numeric-operations/+page.markdoc (2)
56-63: Update placeholders to use <ROW_ID> (not <DOCUMENT_ID>).Terminology migrated to Tables/Rows; examples should reflect
<ROW_ID>.- '<DOCUMENT_ID>', + '<ROW_ID>',Also applies to: 76-83
43-45: Use correct TablesDB SDK methods for atomic operations
ReplaceincrementDocumentAttribute/decrementDocumentAttributewithincrementRowColumn/decrementRowColumnin prose and code examples (lines 43–45, 56–63, 76–83).src/routes/blog/post/appwrite-realtime-for-flutter/+page.markdoc (2)
180-185: Initialize Client with endpoint and fix placeholder inconsistency.Examples omit
setEndpointand use'delete'as a project ID; both will confuse readers and break connectivity.- initState() { + initState() { super.initState(); - client = Client().setProject('<PROJECT_ID>'); // your project id + client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // your API endpoint + .setProject('<PROJECT_ID>'); // your project ID } @@ - initState() { + initState() { super.initState(); - client = Client().setProject('delete'); // your project id + client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') + .setProject('<PROJECT_ID>'); tablesDB = TablesDB(client); loadItems(); subscribe(); } @@ - initState() { + initState() { super.initState(); - client = Client().setProject('delete'); // your project id + client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') + .setProject('<PROJECT_ID>'); tablesDB = TablesDB(client); loadItems(); subscribe(); }Also applies to: 205-213, 335-343
189-194: Dispose the TextEditingController to avoid leaks.Add
_nameController.dispose()indispose().dispose(){ - subscription?.close(); + subscription?.close(); + _nameController.dispose(); super.dispose(); }Also applies to: 384-388
src/routes/blog/post/ai-crystal-ball/+page.markdoc (1)
295-308: Syntax error in createRow call; fix and adopt object-args.
permissions:is not valid as a bare argument; must be part of the options object. Also switch to object-args.- return await tablesDB.createRow( - databaseId, - githubDataTableId, - userId, - { - username, - followers, - following, - languages - }, - permissions: [ - Permission.write(Role.user(userId)), Permission.read(Role.user(userId)) - ] - }) + return await tablesDB.createRow({ + databaseId, + tableId: githubDataTableId, + rowId: userId, + data: { username, followers, following, languages }, + permissions: [ + Permission.write(Role.user(userId)), + Permission.read(Role.user(userId)), + ], + })Object-args pattern reference. (appwrite.io)
src/routes/blog/post/building-init-giveaway-app/+page.markdoc (1)
105-115: Fix OAuthProvider import/export mismatch.appwrite.js no longer exports OAuthProvider, but user.js imports it from './appwrite'. Re-export it here to keep the snippet consistent.
import { Account, Client, TablesDB } from 'appwrite'; import { APPWRITE_ENDPOINT, APPWRITE_PROJECT } from './constants'; export const client = new Client(); client.setEndpoint(APPWRITE_ENDPOINT).setProject(APPWRITE_PROJECT); export const account = new Account(client); export const tablesDB = new TablesDB(client); +// Re-export to support: `import { account, OAuthProvider } from './appwrite'` +export { OAuthProvider } from 'appwrite';src/routes/blog/post/build-personal-crm-sveltekit/+page.markdoc (2)
26-34: Fix column types: phone and notes should be string-based.Integer will drop leading zeros and cannot hold freeform notes. Correct the table to avoid schema pain later.
-| phone | Integer | 25 | No | -| notes | Integer | 2000 | No | +| phone | String | 25 | No | +| notes | String | 2000 | No |
160-166: Fix route path mismatch: created /api/contact but UI calls /api/contacts.Either rename the route directory to
src/routes/api/contacts/+server.jsor update the fetch URLs below to singular.-const response = await fetch('/api/contacts'); +const response = await fetch('/api/contact');-const response = await fetch('/api/contacts', { +const response = await fetch('/api/contact', {-const response = await fetch('/api/contacts', { +const response = await fetch('/api/contact', {-const response = await fetch('/api/contacts', { +const response = await fetch('/api/contact', {Also applies to: 246-259, 304-311, 340-346, 371-379
src/routes/blog/post/best-pagination-technique/+page.markdoc (1)
269-275: Use the cursor variable in the REST example (cursor).The query uses offset instead of cursor. Fix the param.
-http.get(`${config.endpoint}/databases/main/tables/posts/rows?queries[]=${offset}&queries[]=${limit}`, { +http.get(`${config.endpoint}/databases/main/tables/posts/rows?queries[]=${cursor}&queries[]=${limit}`, {src/routes/blog/post/build-fullstack-svelte-appwrite/+page.markdoc (3)
193-210: ID is used but not imported in auth store.register() uses ID.unique() without importing ID, causing a ReferenceError at runtime.
import { writable } from 'svelte/store' import { account } from '$lib/appwrite' +import { ID } from 'appwrite'Also applies to: 232-245
258-265: Update deleteSession to object-arg signature.Recent SDKs use an object parameter; the positional form is deprecated.
- await account.deleteSession('current') + await account.deleteSession({ sessionId: 'current' })Reference: Appwrite Account API (Node/JS) shows deleteSession({ sessionId }). (appwrite.io)
652-662: TablesDB createRow: fix signature and rowId generation.Use object-args and ID.unique() instead of the string 'unique()'.
- await tablesDB.createRow( - DATABASE_ID, - EXPENSES_TABLE_ID, - 'unique()', - expenseData, - [ - Permission.read(Role.user(user.$id)), - Permission.update(Role.user(user.$id)), - Permission.delete(Role.user(user.$id)) - ] - ) + await tablesDB.createRow({ + databaseId: DATABASE_ID, + tableId: EXPENSES_TABLE_ID, + rowId: ID.unique(), + data: expenseData, + permissions: [ + Permission.read(Role.user(user.$id)), + Permission.update(Role.user(user.$id)), + Permission.delete(Role.user(user.$id)), + ], + })TablesDB is the correct service for rows post-terminology update. (appwrite.io)
🧹 Nitpick comments (64)
src/routes/blog/post/how-to-leverage-dynamic-api-keys-for-better-security/+page.markdoc (1)
84-84: Use “row in a table” for precision and consistency with Tables terminology“Row in the database” is slightly imprecise post-migration. Suggest “row in a table” to match the rest of the PR and current TablesDB wording.
-**4. Deploying and testing the function:** [Deploy your function](https://appwrite.io/docs/products/functions/functions) through the Appwrite console or the Appwrite CLI. Test the function by calling its endpoint and verifying that it performs the intended operations, such as creating a new row in the database. +**4. Deploying and testing the function:** [Deploy your function](https://appwrite.io/docs/products/functions/functions) through the Appwrite console or the Appwrite CLI. Test the function by calling its endpoint and verifying that it performs the intended operations, such as creating a new row in a table.src/routes/blog/post/product-update-jan-2025/+page.markdoc (1)
80-80: Capitalize “GitHub”.Brand capitalization.
-Plus, we resolved Github identity conflicts to ensure smooth functionality. +Plus, we resolved GitHub identity conflicts to ensure smooth functionality.src/routes/blog/post/deploy-a-pdf-generation-service-with-appwrite-functions/+page.markdoc (1)
54-56: Tighten Tables terminology and auth guidance for consistencyRecommend explicitly naming Tables/TablesDB and clarifying the auth check to reference a userId column or row.$permissions for consistency with the broader migration.
Apply this minimal copy update:
-2. Get the order row from your Appwrite database, or external data source. Unsure about this? View code recipes on the **[Appwrite Function Docs](https://appwrite.io/docs/functions).** -3. If necessary, use the order row to ensure the user has permission to see the order. For example, compare the `x-appwrite-user-id` header with the row user ID. -4. Change the function to populate the PDF template with the real order row. +2. Get the order row from Appwrite Tables (TablesDB) or your external data source. Unsure about this? See code recipes in the **[Appwrite Function Docs](https://appwrite.io/docs/functions).** +3. Authorize access using the order row—for example, compare the `x-appwrite-user-id` header with a `userId` column on the row, or enforce via `row.$permissions`. +4. Change the function to populate the PDF template with the real order row data.src/routes/blog/post/open-source-firebase-alternative/+page.markdoc (1)
133-133: Nit: Double period after “HTTPS.”Minor punctuation fix.
-- Each platform automatically provisions SSL certificates, ensuring that all content is served securely over HTTPS.. +- Each platform automatically provisions SSL certificates, ensuring that all content is served securely over HTTPS.src/routes/blog/post/product-update-december-2024/+page.markdoc (4)
35-35: Minor heading grammar tweak.Use “An” for natural phrasing.
-## MFA - Extra layer of security +## MFA - An extra layer of security
41-41: Sentence case for “integrations”.Keeps style consistent with the rest of the post.
-In May, we announced multiple AI Integrations to help developers build AI apps. With pre-built functions and an enhanced knowledge base, you can easily add features like natural language processing (NLP), image analysis, and audio processing to your projects. +In May, we announced multiple AI integrations to help developers build AI apps. With pre-built functions and an enhanced knowledge base, you can easily add features like natural language processing (NLP), image analysis, and audio processing to your projects.
49-49: Tighten CLI copy; clarify “table data” and data flow.“Between Appwrite and your CLI” is awkward; also explicitly say “data in existing tables.”
-No more overwriting or deleting existing table data during deployments. With the new Appwrite CLI, you can test functions locally and push or pull data between Appwrite and your CLI seamlessly without affecting existing data. +No more overwriting or deleting data in existing tables during deployments. With the new Appwrite CLI, you can test functions locally and seamlessly push or pull data between your local environment and Appwrite without affecting existing data.Please confirm this statement matches current CLI behavior for Tables (i.e., schema deploys don’t touch existing rows).
61-61: Role names: format consistently and verify exact labels.Use code formatting for literal role names and confirm “Billing” is the exact Console label.
-In September, we launched the much-requested [Roles](https://appwrite.io/blog/post/announcing-roles-for-enhanced-collaboration-and-security) feature, making it easy for larger teams to manage access. Alongside the "Owner" role, new options include Developer, Editor, Analyst, and Billing. +In September, we launched the much-requested [Roles](https://appwrite.io/blog/post/announcing-roles-for-enhanced-collaboration-and-security) feature, making it easy for larger teams to manage access. Alongside the `Owner` role, new options include `Developer`, `Editor`, `Analyst`, and `Billing`.src/routes/blog/post/cors-error/+page.markdoc (3)
65-66: Use Tables API terminology and broaden IDs that can trigger CORSSince Tables listRows requires databaseId/tableId, typos in any of these IDs (not just projectId) can yield 4xx responses and surface as CORS errors. Recommend clarifying.
-This one happens because of an improperly configured request, such as a typo when specifying a project ID. For example, when using the `listRows` method, -if the project ID is set incorrectly when the client is initialized, you will receive a CORS error. +This one happens because of an improperly configured request, such as a typo in your projectId, databaseId, or tableId. For example, when using the Tables API’s `listRows` method, +if any of these IDs (or the projectId used when the client is initialized) is incorrect, you will receive a CORS error.
69-69: Use standard 4xx notation instead of 40XMinor wording tweak for accuracy/consistency.
-The request returns a `40X` response, so the entire CORS check fails. +The request returns a `4xx` response, so the entire CORS check fails.
24-24: Grammar nit: pluralize “request”Small copy edit to improve readability.
-Site A, our server sitting at `myapi.com` won't allow request coming from site B, which is our client app sitting at `myfrontend.com`. +Site A, our server sitting at `myapi.com`, won't allow requests coming from site B, which is our client app sitting at `myfrontend.com`.src/routes/blog/post/open-source-vercel-alternative/+page.markdoc (3)
49-49: Grammar: remove superfluous comma after “although”.-There's no manual UI deployment support, although, there’s a CLI option. +There's no manual UI deployment support, although there’s a CLI option.
58-58: Typo: “CLi” → “CLI”.-...deploy without needing Git or the CLi. +...deploy without needing Git or the CLI.
134-134: Use product-canonical “dynamic API key” terminology
Replace the phrasing to match Appwrite’s official docs and clarify automatic injection:-Appwrite also provides a **dynamic API key automatically**, scoped and injected for both the build process and runtime (for SSR). This makes it easier to create or configure tables at build time, or securely perform server-to-server operations during SSR. +Appwrite automatically generates and injects a dynamic API key (aka ephemeral API key) for both build-time and SSR runtime. This lets you provision or configure tables during builds and securely perform server-to-server operations in SSR.src/routes/blog/post/serverless-functions-best-practices/+page.markdoc (3)
134-134: Terminology consistency: “Databases” → “Tables”To match the PR’s Tables terminology, prefer “Tables” when speaking about access control on rows.
Apply this diff:
- Appwrite Databases and Storage services can be configured to enforce access control rules. For example, you can restrict read and write access to rows by navigating to your database table settings in the Appwrite Console and setting the appropriate permissions. + Appwrite Tables and Storage services can be configured to enforce access control rules. For example, you can restrict read and write access to rows by navigating to your table settings in the Appwrite Console and setting the appropriate permissions.
138-138: Tighten phrasing on execute accessMinor clarity tweak and neutral wording re: SDKs.
Apply this diff:
- You can also configure **execute access** for your Appwrite functions, allowing you to specify who can execute the function using the client API. + You can also configure **execute access** for your Appwrite functions, allowing you to specify who can execute the function via function-level execute permissions (enforced for client SDK calls).
146-146: Grammar fixSubject–verb agreement and smoother wording.
Apply this diff:
- But in addition to that, Appwrite also use encryption for storage. + In addition, Appwrite also uses encryption for storage.src/routes/blog/post/what-is-golang/+page.markdoc (1)
12-12: Avoid time-relative phrasing; anchor to a version/date.Suggest: “Appwrite announced support for the Go SDK and Functions runtime in Appwrite 1.6.” This keeps the post evergreen.
-Appwrite has just announced support for Go SDK and Function runtime in version 1.6. +Appwrite announced support for the Go SDK and Functions runtime in Appwrite 1.6.src/routes/blog/post/improve-devex-dev-keys/+page.markdoc (1)
94-94: Prefer Promise.allSettled for a demo expected to emit 429s.Avoids a single rejection aborting the whole batch, while still logging failures.
- await Promise.all(promises); + await Promise.allSettled(promises);Rate limit on createRow is ~120 req/min for Client SDKs; many calls will reject with 429 in Step 2. (appwrite.io)
src/routes/blog/post/offline-first-journal/+page.markdoc (3)
59-64: Add a caution about permissive “Any” permissions.Good for demos, unsafe for production. Suggest a short callout that production apps should restrict to authenticated users/roles.
159-159: Use RxDB’s own nomenclature (“collections”), not “tables,” to avoid confusion.This sentence should say “create databases and collections.”
-The RxDB imports include core RxDB functionalities to create databases and tables and to add plugins, +The RxDB imports include core RxDB functionalities to create databases and collections and to add plugins,
271-275: Optional: use Mango-style sort to avoid query-builder dependency.You can do a full Mango query with sort instead of chaining. (rxdb.info)
-export const getJournals = async () => { - const db = await getDB(); - return db.entries.find().sort({ updatedAt: 'desc' }).exec(); -}; +export const getJournals = async () => { + const db = await getDB(); + return db.entries.find({ selector: {}, sort: [{ updatedAt: 'desc' }] }).exec(); +};src/routes/blog/post/hacktoberfest-ideas-2024/+page.markdoc (1)
75-75: Grammar: make product/feature phrasing consistentUse plural “Databases” and parenthetical “Tables” for clarity.
- - [Appwrite Database](https://appwrite.io/docs/products/databases) and Tables + - [Appwrite Databases](https://appwrite.io/docs/products/databases) (Tables)src/routes/blog/post/scan-receipts-with-appwrite-functions/+page.markdoc (1)
275-276: Add a short example of persisting to a tableSince this section recommends storing results in a table (event-driven), add a quick snippet showing a createRow call with the server SDK to make it actionable.
src/routes/blog/post/everything-new-with-appwrite-1.5/+page.markdoc (1)
76-76: Terminology aligns; minor wording tweak for precision on containsConsider clarifying “array element matching” to “membership testing” for array columns to better reflect semantics.
Apply this diff:
- - `contains` - partial text matches on string columns, array element matching on array columns + - `contains` - partial text matches on string columns; membership testing on array columnssrc/routes/blog/post/product-update-june/+page.markdoc (2)
29-34: Bulleted items became plain paragraphs — confirm intentSeveral lines lost the leading dash, changing list items into paragraphs. If that wasn’t intentional, restore the dashes to keep list styling.
Also applies to: 43-44, 55-56
71-71: Standardize terminology: collections → tablesElsewhere we use tables/rows/columns. Update for consistency.
Apply this diff:
- - [Fix for migration of collections, columns and indexes of Databases](https://github.com/appwrite/appwrite/issues/8044) + - [Fix for migration of tables, columns, and indexes of Databases](https://github.com/appwrite/appwrite/issues/8044)src/routes/blog/post/announcing-roles-for-enhanced-collaboration-and-security/+page.markdoc (1)
31-34: Replace relative dates with absolute dates for the promo window“Until the end of the year” and “Starting in the new year” will go stale. Use concrete dates to avoid confusion.
Apply this diff with the actual dates:
- The new feature is now available on both the Pro and Scale plans. To celebrate the new feature, until the end of the year, you can invite members with the new roles to your Pro teams for free! This is the perfect opportunity to explore the new feature and see how it enhances your team's workflow. - Starting in the new year, member seats will be priced at $15 per month as part of our standard pricing. + The new feature is now available on both the Pro and Scale plans. To celebrate the new feature, until December 31, 2024, you can invite members with the new roles to your Pro teams for free. This is the perfect opportunity to explore the new feature and see how it enhances your team's workflow. + Starting January 1, 2025, member seats will be priced at $15 per month as part of our standard pricing.src/routes/blog/post/announcing-type-generation-feature/+page.markdoc (1)
24-30: Specify minimum CLI version: Theappwrite pull tablescommand was introduced in Appwrite CLI v6.0.0. Update the snippet to require “Appwrite CLI v6.0.0+”.src/routes/blog/post/introducing-new-database-operators/+page.markdoc (2)
26-32: Use Tables client and object-style params for listRows.Recent Tables API examples use the Tables client and object params. Also align naming with tablesDB per our tutorials learning.
Based on your retrieved learnings for tutorials, consider:
-db.listRows( - '<DATABASE_ID>', - '<TABLE_ID>', - [ - Query.contains('content', ['happy', 'love']), - ] - ) +tablesDB.listRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [ + Query.contains('content', ['happy', 'love']), + ], +})Note: If this blog intentionally uses positional args, please confirm the SDK version this targets.
35-35: Clarify array-column phrasing."set a string column to act as an array" can confuse readers. Prefer "create a string[] column (array=true)".
-It’s important to note that the contains operator also works on array columns as well. For example, if we set a string column to act as an array, you could search this array in the same way you would search any other string. +It’s important to note that the contains operator also works on array columns. For example, if you define a string[] column (array=true), you can search this array the same way as strings.src/routes/blog/post/manage-user-permissions-with-labels-and-teams/+page.markdoc (1)
81-81: Capitalize brand and Console.Minor polish.
-That's it for creating a Team and adding members from the appwrite console. +That's it for creating a Team and adding members from the Appwrite Console.src/routes/blog/post/announcing-go-support/+page.markdoc (2)
191-216: Storage example compiles, but keep imports tidy.No issues; consider grouping imports, but optional.
219-219: Grammar nit."the ones the return" → "the ones that return".
-Some of our API endpoints such as the ones that return preferences from the Accounts and Teams APIs as well as the ones the return rows from the Appwrite Database are loosely typed... +Some of our API endpoints—such as those that return preferences from the Accounts and Teams APIs, as well as those that return rows from the Appwrite Database—are loosely typed...src/routes/blog/post/simplify-your-data-management-with-relationships/+page.markdoc (1)
50-51: Grammar: “a column” (not “an column”)-...the reviews table will not have an column containing the related movie. +...the reviews table will not have a column containing the related movie.src/routes/blog/post/how-to-execute-database-migration-with-appwrite-cli/+page.markdoc (2)
61-63: Stale terminology (“collections”)This section still references “collections”; the rest of the post uses “tables”.
-To make changes to your collections, edit the `appwrite.config.json` file. +To make changes to your tables, edit the `appwrite.config.json` file.
95-104: Avoid storing phone numbers as integersPhone numbers aren’t numeric (leading zeros, formatting, country codes). Prefer string.
{ "key": "phone", - "type": "integer", + "type": "string", "status": "available", "error": "", "required": false, "array": false, - "min": 1, - "max": 100, + "min": 1, + "max": 32, "default": null}src/routes/blog/post/announcing-csv-imports/+page.markdoc (1)
25-25: Wording: avoid repetition (“row represents a row”)-- Each subsequent row represents a row, with values separated by commas +- Each subsequent line represents a data row, with values separated by commassrc/routes/blog/post/how-to-optimize-your-appwrite-project/+page.markdoc (2)
4-4: Typo in description (“yout” → “your”)-description: Learn how to optimize your Appwrite project, manage resource usage, costs, and ensure smooth performance as yout application scales. +description: Learn how to optimize your Appwrite project, manage resource usage, costs, and ensure smooth performance as your application scales.
249-249: Broken link schemeMissing slashes in URL.
-- [Serverless functions 101: Best practices](http:appwrite.io/blog/post/serverless-functions-best-practices) +- [Serverless functions 101: Best practices](https://appwrite.io/blog/post/serverless-functions-best-practices)src/routes/blog/post/announcing-auto-increment-support/+page.markdoc (1)
40-40: Use “column” consistently (not “field”).Terminology in this PR adopts “columns.” Align this sentence.
-For numeric ordering based on insertion order, you can use the `$sequence` field, which Appwrite automatically adds to all rows. This field increments with each new insert. +For numeric ordering based on insertion order, you can use the `$sequence` column, which Appwrite automatically adds to all rows. This column increments with each new insert.src/routes/blog/post/introducing-new-appwrite-cli/+page.markdoc (4)
12-12: Pluralize “table” → “tables.”Reads better and matches service naming elsewhere.
-...apply changes to your Appwrite table. +...apply changes to your Appwrite tables.
92-92: Use the correct service name in the command.Standardize on
appwrite push tables.-When running `appwrite push table`, the CLI will compare... +When running `appwrite push tables`, the CLI will compare...
108-113: Tighten grammar and code punctuation.Move comma outside backticks and fix “read” → “recreated.”
-In this example, we can see that because we've renamed the column `times` to `time,` it will get deleted and read. We must also recreate the `timezone` column because we've changed its size from 256 to 255. +In this example, because we've renamed the column `times` to `time`, it will be deleted and recreated. We must also recreate the `timezone` column because we've changed its size from 256 to 255.
120-121: Keep punctuation outside inline code.Remove trailing comma and period from inside backticks.
-...such as `appwrite push tables,` to pre-answer all of them with `YES.` +...such as `appwrite push tables`, to pre-answer all of them with `YES`.src/routes/blog/post/introducing-functions-ecosystem/+page.markdoc (2)
67-76: “scheduledAt” is a parameter, not a column.Adjust the comment to avoid DB terminology here.
- invoiceDate.toISOString() // New scheduledAt column + invoiceDate.toISOString() // New scheduledAt parameter
119-121: Use “fields” instead of “columns” for Functions metadata.Columns are DB-specific; executions/deployments have fields/attributes.
-You can now filter Function executions and deployments based on various columns, making it easier to monitor and debug your Functions: +You can now filter Function executions and deployments based on various fields, making it easier to monitor and debug your Functions:src/routes/blog/post/3-things-you-can-build-with-go-runtime/+page.markdoc (3)
202-204: Use “tableId” consistently instead of “collId” for clarity.You’ve migrated to Tables/Rows, but variable names still say “collId”. Rename for consistency/readability.
-func DoesTableExist(dbs tablesdb.TablesDB, dbId string, collId string) bool { - _, err := dbs.GetTable(dbId, collId) +func DoesTableExist(dbs tablesdb.TablesDB, dbId string, tableId string) bool { + _, err := dbs.GetTable(dbId, tableId) @@ -func DoesColumnExist(dbs tablesdb.TablesDB, dbId string, collId string, attribId string) bool { - _, err := dbs.GetColumn(dbId, collId, attribId) +func DoesColumnExist(dbs tablesdb.TablesDB, dbId string, tableId string, attribId string) bool { + _, err := dbs.GetColumn(dbId, tableId, attribId) @@ -func InitialiseDatabase(Context openruntimes.Context, dbs tablesdb.TablesDB, dbId string, collId string) { +func InitialiseDatabase(Context openruntimes.Context, dbs tablesdb.TablesDB, dbId string, tableId string) { @@ - doesCollExist := DoesTableExist(dbs, dbId, collId) + doesCollExist := DoesTableExist(dbs, dbId, tableId) @@ - dbs.CreateTable( - dbId, - collId, + dbs.CreateTable( + dbId, + tableId, @@ - doesAttribExist := DoesColumnExist(dbs, dbId, collId, "longUrl") + doesAttribExist := DoesColumnExist(dbs, dbId, tableId, "longUrl") @@ - dbs.CreateUrlColumn( - dbId, - collId, + dbs.CreateUrlColumn( + dbId, + tableId, @@ -collId := "urlTable" -services.InitialiseDatabase(Context, *tablesDB, dbId, collId) +tableId := "urlTable" +services.InitialiseDatabase(Context, *tablesDB, dbId, tableId) @@ -row, err := tablesDB.GetRow(dbId, collId, shortId) +row, err := tablesDB.GetRow(dbId, tableId, shortId)Also applies to: 227-234, 237-246, 283-286, 329-338
218-248: Prefer passing a pointer to TablesDB to avoid copying and make the intent explicit.Service methods likely have pointer receivers; passing by pointer avoids unnecessary copies and is idiomatic.
-func InitialiseDatabase(Context openruntimes.Context, dbs tablesdb.TablesDB, dbId string, tableId string) { +func InitialiseDatabase(Context openruntimes.Context, dbs *tablesdb.TablesDB, dbId string, tableId string) { @@ -services.InitialiseDatabase(Context, *tablesDB, dbId, tableId) +services.InitialiseDatabase(Context, tablesDB, dbId, tableId)Also applies to: 279-286
348-349: Tighten the scope list and fix punctuation.Remove trailing comma; also verify whether both
databases.*and{tables,columns,rows}.*are all required for this example.-... `databases.read`, `databases.write`, `tables.read`, `tables.write`, `columns.read`, `columns.write`, `rows.read`, `rows.write`, +... `databases.read`, `databases.write`, `tables.read`, `tables.write`, `columns.read`, `columns.write`, `rows.read`, `rows.write`.Would you confirm the minimal scopes needed (especially if creating DB/table/column at runtime)?
src/routes/blog/post/announcing-atomic-numeric-operations/+page.markdoc (1)
89-96: Concurrency phrasing check.“The row is locked during the update” — confirm this reflects the actual implementation (atomic server-side write vs. explicit row lock). Adjust wording if needed.
src/routes/blog/post/appwrite-realtime-for-flutter/+page.markdoc (2)
236-239: Subscribe to a scoped rows channel to reduce noise.
'rows'listens to all rows across all DBs/tables. Scope to your DB/table for fewer events and better perf.- subscription = realtime.subscribe([ - 'rows' // subscribe to all rows in every database and table - ]); + subscription = realtime.subscribe([ + 'databases.${database}.tables.${itemsTable}.rows' // only this table's rows + ]);Please confirm the exact channel pattern for rows in the latest Flutter SDK docs.
Also applies to: 362-364
199-205: Minor terminology tweak (optional).“Appwrite database service” → “Appwrite Tables service” to match TablesDB.
src/routes/blog/post/encrypted-attributes-for-sensitive-fields/+page.markdoc (3)
3-5: Align title/description terminology (“columns” vs “attributes”).Description still mentions “encrypted string attributes.” Update to “columns” for consistency with the title/body.
title: Secure sensitive database fields with encrypted string columns -description: Learn how to use encrypted string attributes to protect sensitive data in your Appwrite database. +description: Learn how to use encrypted string columns to protect sensitive data in your Appwrite database.
85-85: Grammar: “an column” → “a column”.Quick copyedit.
-Once an column is marked as encrypted, that decision cannot be reversed. +Once a column is marked as encrypted, that decision cannot be reversed.
94-94: Punctuation: add period.Minor polish.
-If you are unsure, it is better to begin with unencrypted fields and migrate later once your needs are clearer +If you are unsure, it is better to begin with unencrypted fields and migrate later once your needs are clearer.src/routes/blog/post/track-document-order-with-sequence/+page.markdoc (1)
157-157: Wording: “id columns” → “id attributes”.These are HTML attributes.
-This form captures the ticket title and description. Note the `id` columns on the form and inputs. +This form captures the ticket title and description. Note the `id` attributes on the form and inputs.src/routes/blog/post/ai-crystal-ball/+page.markdoc (1)
509-509: Remove stray**in export.Typo will break the code snippet.
-export const db = {** +export const db = {src/routes/blog/post/building-init-giveaway-app/+page.markdoc (1)
345-349: Optionally narrow Realtime to create events only.Avoid reacting to updates/deletes by scoping to creation events.
- return client.subscribe( - `databases.${DATABASE_NAME}.tables.${TABLE_NAME}.rows`, + return client.subscribe( + `databases.${DATABASE_NAME}.tables.${TABLE_NAME}.rows.*.create`, (response) => { // ... } );src/routes/blog/post/build-personal-crm-sveltekit/+page.markdoc (1)
165-167: Remove unused imports.ID and Query are not used in +server.js after the refactor.
-import { ID, Query } from 'node-appwrite'; +// import { Query } from 'node-appwrite';src/routes/blog/post/best-pagination-technique/+page.markdoc (1)
48-51: Typo: add spacing around the “sum” column.Minor readability fix.
-`sum`column +`sum` columnsrc/routes/blog/post/build-fullstack-svelte-appwrite/+page.markdoc (3)
75-77: Permissions and Row Security guidance: grammar + clarity nits.
- Line 92: lowercase “Open” → “open”.
- All good on enabling Row Security and table-level Create for Users; keep the screenshot step.
Apply:
- To ensure that users can only access their own expenses, Open the table's **Settings** tab ... + To ensure that users can only access their own expenses, open the table's **Settings** tab ...Also applies to: 90-96
156-156: “column” → “attribute”It’s an HTML attribute, not a column.
- The `data-sveltekit-preload-data="hover"` column enables ... + The `data-sveltekit-preload-data="hover"` attribute enables ...
281-283: Unused import (optional).ID isn’t used in +page.svelte; import lives in the store. Safe to remove.
- import { ID } from 'appwrite'
| Aside from environment variables at the function level, Appwrite also allows you to environment variables at the project level so that they can be shared across multiple functions in a single project. | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix grammar in “Global environment variables” section.
“…allows you to environment variables…” → “…allows you to define environment variables…”.
-Aside from environment variables at the function level, Appwrite also allows you to environment variables at the project level so that they can be shared across multiple functions in a single project.
+Aside from environment variables at the function level, Appwrite also allows you to define environment variables at the project level so they can be shared across multiple functions in a single project.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| Aside from environment variables at the function level, Appwrite also allows you to environment variables at the project level so that they can be shared across multiple functions in a single project. | |
| Aside from environment variables at the function level, Appwrite also allows you to define environment variables at the project level so they can be shared across multiple functions in a single project. |
🤖 Prompt for AI Agents
In src/routes/blog/post/3-things-you-can-build-with-go-runtime/+page.markdoc
around lines 32-33, the sentence currently reads "Appwrite also allows you to
environment variables at the project level..."; change it to "Appwrite also
allows you to define environment variables at the project level so that they can
be shared across multiple functions in a single project." — replace the
incorrect phrase "allows you to environment variables" with "allows you to
define environment variables" and ensure the sentence punctuation and spacing
remain correct.
|  | ||
|
|
||
| The function requires `APPWRITE_API_KEY`, `APPWRITE_DATABASE_ID`, `APPWRITE_COLLECTION_ID` , `MEILISEARCH_ENDPOINT`, `MEILISEARCH_ADMIN_API_KEY`, `MEILISEARCH_SEARCH_API_KEY`, `MEILISEARCH_INDEX_NAME`. Once you have added them you can proceed to the Connect step. | ||
| The function requires `APPWRITE_API_KEY`, `APPWRITE_DATABASE_ID`, `APPWRITE_TABLE_ID` , `MEILISEARCH_ENDPOINT`, `MEILISEARCH_ADMIN_API_KEY`, `MEILISEARCH_SEARCH_API_KEY`, `MEILISEARCH_INDEX_NAME`. Once you have added them you can proceed to the Connect step. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Unify API key env var name.
You use APPWRITE_KEY above and APPWRITE_API_KEY here. Pick one and use consistently (docs/Console show “API Key”).
-The function requires `APPWRITE_API_KEY`, `APPWRITE_DATABASE_ID`, `APPWRITE_TABLE_ID` , `MEILISEARCH_ENDPOINT`, ...
+The function requires `APPWRITE_KEY`, `APPWRITE_DATABASE_ID`, `APPWRITE_TABLE_ID`, `MEILISEARCH_ENDPOINT`, ...Or replace earlier mention with APPWRITE_API_KEY—just be consistent across the post and template.
🏁 Script executed:
#!/bin/bash
file="src/routes/blog/post/add-a-search-function-to-your-app/+page.markdoc"
echo "Searching for APPWRITE_KEY..."
rg -n "APPWRITE_KEY" "$file" || echo "No occurrences of APPWRITE_KEY found."
echo
echo "Searching for APPWRITE_API_KEY..."
rg -n "APPWRITE_API_KEY" "$file" || echo "No occurrences of APPWRITE_API_KEY found."Length of output: 510
Unify Appwrite API key env var name
Replace APPWRITE_API_KEY with APPWRITE_KEY in the env var list (line 66) to match the earlier definition at line 23.
-The function requires `APPWRITE_API_KEY`, `APPWRITE_DATABASE_ID`, `APPWRITE_TABLE_ID`, …
+The function requires `APPWRITE_KEY`, `APPWRITE_DATABASE_ID`, `APPWRITE_TABLE_ID`, …📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| The function requires `APPWRITE_API_KEY`, `APPWRITE_DATABASE_ID`, `APPWRITE_TABLE_ID` , `MEILISEARCH_ENDPOINT`, `MEILISEARCH_ADMIN_API_KEY`, `MEILISEARCH_SEARCH_API_KEY`, `MEILISEARCH_INDEX_NAME`. Once you have added them you can proceed to the Connect step. | |
| The function requires `APPWRITE_KEY`, `APPWRITE_DATABASE_ID`, `APPWRITE_TABLE_ID`, `MEILISEARCH_ENDPOINT`, `MEILISEARCH_ADMIN_API_KEY`, `MEILISEARCH_SEARCH_API_KEY`, `MEILISEARCH_INDEX_NAME`. Once you have added them you can proceed to the Connect step. |
🤖 Prompt for AI Agents
In src/routes/blog/post/add-a-search-function-to-your-app/+page.markdoc around
line 66 (reference earlier definition at line 23), update the environment
variable list to use APPWRITE_KEY instead of APPWRITE_API_KEY so it matches the
previously defined name; change the single env var entry and verify any other
occurrences in this file use APPWRITE_KEY for consistency.
|
|
||
| How can the *template* be extended ? | ||
| - Using events to automatically index new collections | ||
| - Using events to automatically index new tables |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
"tables" → "rows" (semantic fix).
Events will index new/changed rows, not new tables.
- Using events to automatically index new tables
+ Using events to automatically index new rows📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - Using events to automatically index new tables | |
| - Using events to automatically index new rows |
🤖 Prompt for AI Agents
In src/routes/blog/post/add-a-search-function-to-your-app/+page.markdoc around
line 87, the heading/text uses "tables" but is semantically incorrect; change
"Using events to automatically index new tables" to "Using events to
automatically index new rows" (or update any nearby occurrences of "tables" to
"rows" where the intent is indexing row-level changes) so the content accurately
states that events index new/changed rows rather than new tables.
| getUserData: async(rowId) => { | ||
| try{ | ||
| return await databases.getDocument({ | ||
| return await tablesDB.getRow( | ||
| databaseId, | ||
| collectionId: githubDataCollectionId, | ||
| documentId | ||
| }); | ||
| githubDataTableId, | ||
| rowId | ||
| ); | ||
| } catch(err){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Use object-args for getRow.
Update to modern calling convention.
- return await tablesDB.getRow(
- databaseId,
- githubDataTableId,
- rowId
- );
+ return await tablesDB.getRow({
+ databaseId,
+ tableId: githubDataTableId,
+ rowId
+ });References: JS examples use object arguments. (appwrite.io)
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| getUserData: async(rowId) => { | |
| try{ | |
| return await databases.getDocument({ | |
| return await tablesDB.getRow( | |
| databaseId, | |
| collectionId: githubDataCollectionId, | |
| documentId | |
| }); | |
| githubDataTableId, | |
| rowId | |
| ); | |
| } catch(err){ | |
| getUserData: async(rowId) => { | |
| try{ | |
| return await tablesDB.getRow({ | |
| databaseId, | |
| tableId: githubDataTableId, | |
| rowId | |
| }); | |
| } catch(err){ |
🤖 Prompt for AI Agents
In src/routes/blog/post/ai-crystal-ball/+page.markdoc around lines 282–289,
update the getRow call to use object-style arguments instead of positional ones:
replace tablesDB.getRow(databaseId, githubDataTableId, rowId) with a single
object argument following the SDK convention (include databaseId, collectionId
set to githubDataTableId, and documentId set to rowId) so the call becomes
tablesDB.getRow({ databaseId, collectionId: githubDataTableId, documentId: rowId
}); ensure error handling remains unchanged.
| return await tablesDB.createRow( | ||
| databaseId, | ||
| collectionId: destinyCollectionId, | ||
| documentId: ID.unique(), | ||
| data: { | ||
| destinyTableId, | ||
| ID.unique(), | ||
| { | ||
| username, | ||
| destiny | ||
| } | ||
| }) | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Adopt object-args in addDestiny.
Modernize createRow usage.
- return await tablesDB.createRow(
- databaseId,
- destinyTableId,
- ID.unique(),
- {
- username,
- destiny
- }
- })
+ return await tablesDB.createRow({
+ databaseId,
+ tableId: destinyTableId,
+ rowId: ID.unique(),
+ data: { username, destiny },
+ })📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| return await tablesDB.createRow( | |
| databaseId, | |
| collectionId: destinyCollectionId, | |
| documentId: ID.unique(), | |
| data: { | |
| destinyTableId, | |
| ID.unique(), | |
| { | |
| username, | |
| destiny | |
| } | |
| }) | |
| }, | |
| return await tablesDB.createRow({ | |
| databaseId, | |
| tableId: destinyTableId, | |
| rowId: ID.unique(), | |
| data: { username, destiny }, | |
| }) | |
| }, |
🤖 Prompt for AI Agents
In src/routes/blog/post/ai-crystal-ball/+page.markdoc around lines 514-523, the
addDestiny call still uses positional args for tablesDB.createRow; update it to
use Appwrite's object-argument form: call createRow with a single object
containing databaseId, collectionId/tableId (destinyTableId), rowId:
ID.unique(), and data: { username, destiny } (remove the old positional
parameters and trailing mismatched parenthesis).
| const movieData2 = tablesDB.listRows( | ||
| '[DATABASE_ID]', | ||
| '[TABLE_ID]', | ||
| Query.and([ | ||
| Query.startsWith("title", "Once"), | ||
| Query.greaterThan('year', 1995) | ||
| ]) | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue for AND example
-const movieData2 = tablesDB.listRows(
- '[DATABASE_ID]',
- '[TABLE_ID]',
- Query.and([
- Query.startsWith("title", "Once"),
- Query.greaterThan('year', 1995)
- ])
-);
+const movieData2 = tablesDB.listRows({
+ databaseId: '[DATABASE_ID]',
+ tableId: '[TABLE_ID]',
+ queries: [
+ Query.and([
+ Query.startsWith('title', 'Once'),
+ Query.greaterThan('year', 1995),
+ ]),
+ ],
+});📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const movieData2 = tablesDB.listRows( | |
| '[DATABASE_ID]', | |
| '[TABLE_ID]', | |
| Query.and([ | |
| Query.startsWith("title", "Once"), | |
| Query.greaterThan('year', 1995) | |
| ]) | |
| ); | |
| const movieData2 = tablesDB.listRows({ | |
| databaseId: '[DATABASE_ID]', | |
| tableId: '[TABLE_ID]', | |
| queries: [ | |
| Query.and([ | |
| Query.startsWith('title', 'Once'), | |
| Query.greaterThan('year', 1995), | |
| ]), | |
| ], | |
| }); |
🤖 Prompt for AI Agents
In src/routes/blog/post/understand-data-queries/+page.markdoc around lines 96 to
103, the AND example uses Query.and with an array (Query.and([ ... ])) which
mirrors the same mistake flagged earlier; change it to pass the predicate
expressions as separate arguments (e.g., Query.and(expr1, expr2)) or use the
correct API form (spread the array into Query.and) so the combined query is
constructed using the expected function signature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review continued from previous batch...
| <script lang="ts"> | ||
| import { onMount } from 'svelte' | ||
| import { databases, account } from '$lib/appwrite' | ||
| import { DATABASE_ID, EXPENSES_COLLECTION_ID } from '$lib/appwrite' | ||
| import { DATABASE_ID, EXPENSES_TABLE_ID } from '$lib/appwrite' | ||
| import { Query, Permission, Role } from 'appwrite' | ||
| import { formatDistanceToNow } from 'date-fns' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import the right SDK instance and add ID.
This file calls tablesDB but imports databases. Fix import and fold IDs into the same line.
- import { databases, account } from '$lib/appwrite'
- import { DATABASE_ID, EXPENSES_TABLE_ID } from '$lib/appwrite'
+ import { tablesDB, account, DATABASE_ID, EXPENSES_TABLE_ID } from '$lib/appwrite'
- import { Query, Permission, Role } from 'appwrite'
+ import { ID, Query, Permission, Role } from 'appwrite'📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| <script lang="ts"> | |
| import { onMount } from 'svelte' | |
| import { databases, account } from '$lib/appwrite' | |
| import { DATABASE_ID, EXPENSES_COLLECTION_ID } from '$lib/appwrite' | |
| import { DATABASE_ID, EXPENSES_TABLE_ID } from '$lib/appwrite' | |
| import { Query, Permission, Role } from 'appwrite' | |
| import { formatDistanceToNow } from 'date-fns' | |
| <script lang="ts"> | |
| import { onMount } from 'svelte' | |
| import { tablesDB, account, DATABASE_ID, EXPENSES_TABLE_ID } from '$lib/appwrite' | |
| import { ID, Query, Permission, Role } from 'appwrite' | |
| import { formatDistanceToNow } from 'date-fns' |
🤖 Prompt for AI Agents
In src/routes/blog/post/build-fullstack-svelte-appwrite/+page.markdoc around
lines 533–538, the code imports "databases" but the file uses "tablesDB" and the
two ID constants are on separate lines; change the import to import tablesDB
(the SDK instance actually used) and combine the two ID constants into a single
import statement (e.g., import { tablesDB, account, DATABASE_ID,
EXPENSES_TABLE_ID } from '$lib/appwrite'), keeping other named imports (Query,
Permission, Role, formatDistanceToNow) unchanged.
src/routes/blog/post/build-fullstack-svelte-appwrite/+page.markdoc
Outdated
Show resolved
Hide resolved
src/routes/blog/post/build-fullstack-svelte-appwrite/+page.markdoc
Outdated
Show resolved
Hide resolved
src/routes/blog/post/build-fullstack-svelte-appwrite/+page.markdoc
Outdated
Show resolved
Hide resolved
…kdoc Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…kdoc Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…kdoc Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (2)
src/routes/blog/post/understand-data-queries/+page.markdoc (2)
86-93: Use object-arg listRows and pass queries as an array.Current call uses positional args and a single Query expression; TablesDB expects queries as an array, and examples should prefer the object-argument form. [Duplicate of earlier feedback, still present here.]
Apply:
-const movieData1 = tablesDB.listRows( - '[DATABASE_ID]', - '[TABLE_ID]', - Query.or([ - Query.equal('title', ['Back To The Future', 'Top Gun']), - Query.greaterThan('year', 2017) - ]) -); +const movieData1 = await tablesDB.listRows({ + databaseId: '[DATABASE_ID]', + tableId: '[TABLE_ID]', + queries: [ + Query.or([ + Query.equal('title', ['Back To The Future', 'Top Gun']), + Query.greaterThan('year', 2017), + ]), + ], +});Queries are passed via the queries array, and logical operators nest sub-queries. (appwrite.io)
96-103: Same fix for AND example: object-arg + queries array.Maintain parity with the OR example and SDK conventions. [Duplicate of earlier feedback.]
-const movieData2 = tablesDB.listRows( - '[DATABASE_ID]', - '[TABLE_ID]', - Query.and([ - Query.startsWith("title", "Once"), - Query.greaterThan('year', 1995) - ]) -); +const movieData2 = await tablesDB.listRows({ + databaseId: '[DATABASE_ID]', + tableId: '[TABLE_ID]', + queries: [ + Query.and([ + Query.startsWith('title', 'Once'), + Query.greaterThan('year', 1995), + ]), + ], +});AND/OR group nested sub-queries, and queries must be an array passed to list endpoints. (appwrite.io)
🧹 Nitpick comments (2)
src/routes/blog/post/understand-data-queries/+page.markdoc (2)
70-70: Nit: Prefer method-style naming.Consider “listRows API” (camelCase) instead of “list rows API” for consistency with the SDK.
106-110: LGTM; aligns with object-arg form.Optional: add await for consistency with the other examples.
-const movieData3 = tablesDB.listRows({ +const movieData3 = await tablesDB.listRows({ databaseId: '[DATABASE_ID]', tableId: '[TABLE_ID]', queries: [Query.contains('director', ['Christopher Nolan'])], });
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/routes/blog/post/build-fullstack-svelte-appwrite/+page.markdoc(8 hunks)src/routes/blog/post/understand-data-queries/+page.markdoc(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- src/routes/blog/post/build-fullstack-svelte-appwrite/+page.markdoc
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: ebenezerdon
PR: appwrite/website#2372
File: src/routes/docs/tutorials/nuxt/step-6/+page.markdoc:79-83
Timestamp: 2025-09-05T19:35:04.162Z
Learning: In Nuxt tutorial files, the correct Appwrite database instance to use is `tablesDB` (imported from "~/appwrite"), not `database`. All tablesDB method calls should use the object parameter format: listRows({ databaseId, tableId, queries }), createRow({ databaseId, tableId, rowId, data }), and deleteRow({ databaseId, tableId, rowId }).
Learnt from: ebenezerdon
PR: appwrite/website#2372
File: src/routes/docs/tutorials/react/step-6/+page.markdoc:70-75
Timestamp: 2025-09-05T19:35:53.943Z
Learning: In React tutorial files, the correct Appwrite database instance to import is `tablesDB` from "../appwrite", not `databases`. The import statement should be `import { tablesDB } from "../appwrite"` to match the usage throughout the React tutorial code.
Learnt from: ebenezerdon
PR: appwrite/website#2372
File: src/routes/docs/tutorials/react-native/step-6/+page.markdoc:67-73
Timestamp: 2025-09-05T19:35:59.449Z
Learning: In React Native tutorials, the lib/appwrite.js file exports `tablesDB` (not `databases`), so imports should use `import { tablesDB } from "../lib/appwrite"` to match the export pattern established in step-3.
Learnt from: ebenezerdon
PR: appwrite/website#2372
File: src/routes/docs/tutorials/react-native/step-6/+page.markdoc:67-73
Timestamp: 2025-09-05T19:35:59.449Z
Learning: In React Native tutorials, the lib/appwrite.js file exports `tablesDB` (not `databases`), so imports should use `import { tablesDB } from "../lib/appwrite"` to match the export pattern established in step-3.
📚 Learning: 2025-09-05T19:35:04.162Z
Learnt from: ebenezerdon
PR: appwrite/website#2372
File: src/routes/docs/tutorials/nuxt/step-6/+page.markdoc:79-83
Timestamp: 2025-09-05T19:35:04.162Z
Learning: In Nuxt tutorial files, the correct Appwrite database instance to use is `tablesDB` (imported from "~/appwrite"), not `database`. All tablesDB method calls should use the object parameter format: listRows({ databaseId, tableId, queries }), createRow({ databaseId, tableId, rowId, data }), and deleteRow({ databaseId, tableId, rowId }).
Applied to files:
src/routes/blog/post/understand-data-queries/+page.markdoc
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: build
- GitHub Check: tests
🔇 Additional comments (1)
src/routes/blog/post/understand-data-queries/+page.markdoc (1)
77-84: Import and instantiation look good.TablesDB usage aligns with the new API surface.
|
|
||
| # Querying the Appwrite Database | ||
|
|
||
| A lot of developers today don’t perform raw SQL queries but prefer to use an ORM such as Prima or a managed database provider such as Appwrite. While these tools enable the same end goal, a managed service can provide an easy-to-use wrapper and helper methods that make these queries easier to write and don’t require you to have a deep knowledge of SQL syntax. Appwrite offers the aforementioned data queries as a part of our Database product, which you can discover in our [product documentation](/docs/products/databases). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix typo: “Prima” → “Prisma”.
ORM name is misspelled.
- A lot of developers today don’t perform raw SQL queries but prefer to use an ORM such as Prima or a managed database provider such as Appwrite.
+ A lot of developers today don’t perform raw SQL queries but prefer to use an ORM such as Prisma or a managed database provider such as Appwrite.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| A lot of developers today don’t perform raw SQL queries but prefer to use an ORM such as Prima or a managed database provider such as Appwrite. While these tools enable the same end goal, a managed service can provide an easy-to-use wrapper and helper methods that make these queries easier to write and don’t require you to have a deep knowledge of SQL syntax. Appwrite offers the aforementioned data queries as a part of our Database product, which you can discover in our [product documentation](/docs/products/databases). | |
| A lot of developers today don’t perform raw SQL queries but prefer to use an ORM such as Prisma or a managed database provider such as Appwrite. |
🤖 Prompt for AI Agents
In src/routes/blog/post/understand-data-queries/+page.markdoc around line 68,
the ORM name is misspelled as “Prima”; update the text to “Prisma” so the
sentence reads correctly and any links/mentions remain unchanged, preserving
punctuation and spacing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/routes/blog/post/how-to-optimize-your-appwrite-project/+page.markdoc (2)
56-64: Use object-argument form for listRows.The second pagination example also uses positional arguments instead of the object-argument form.
Based on learnings
Apply this diff:
-const secondPage = await tablesDB.listRows( - '<DATABASE_ID>', - '<TABLE_ID>', - [ - Query.equal('author', 'Meredith Palmer'), - Query.limit(20), - Query.offset(20), // Fetch the next 20 records - ] -}) +const secondPage = await tablesDB.listRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [ + Query.equal('author', ['Meredith Palmer']), + Query.limit(20), + Query.offset(20), // Fetch the next 20 records + ] +});
253-253: Update outdated terminology in FAQ.The FAQ section still references
listDocuments()instead oflistRows(), which is inconsistent with the terminology migration in this PR.Apply this diff:
-Use smart querying with `listDocuments()` and filters instead of multiple requests. Combine queries, enable pagination, and use the Realtime API for live updates instead of polling. This reduces server load and speeds up responses. +Use smart querying with `listRows()` and filters instead of multiple requests. Combine queries, enable pagination, and use the Realtime API for live updates instead of polling. This reduces server load and speeds up responses.
♻️ Duplicate comments (5)
src/routes/blog/post/improve-devex-dev-keys/+page.markdoc (3)
30-30: Version requirement and CORS setup need updates (see previous comments).The existing review comment correctly identifies that TablesDB requires Appwrite 1.8+ and that a Web platform configuration step should be added to avoid CORS errors.
84-89: createRow should use object-parameter syntax (see previous comment).The existing review comment correctly identifies that the positional argument syntax is deprecated. Based on learnings from tutorial files, the correct pattern is
createRow({ databaseId, tableId, rowId, data }).
98-98: Terminology updated, but error explanation needs clarification (see previous comment).The "rows" terminology is correct. However, the existing review comment correctly identifies that the explanation should distinguish between CORS errors (when no Web platform is configured) and 429 rate limit errors.
src/routes/blog/post/how-to-optimize-your-appwrite-project/+page.markdoc (2)
30-34: Use object-argument form for listRows consistency.This code example uses positional arguments, which is inconsistent with the SDK usage pattern. Based on learnings, tablesDB methods should use object parameter format.
This issue was already flagged in a previous review comment.
46-54: Use object-argument form for listRows.The pagination example uses positional arguments, which is inconsistent with the SDK usage pattern established elsewhere in the codebase.
Based on learnings
Apply this diff to use the object-argument form:
-const firstPage = await tablesDB.listRows( - '<DATABASE_ID>', - '<TABLE_ID>', - [ - Query.equal('author', 'Meredith Palmer'), - Query.limit(20), - Query.offset(0),// Fetch the first 20 records - ] -}) +const firstPage = await tablesDB.listRows({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [ + Query.equal('author', ['Meredith Palmer']), + Query.limit(20), + Query.offset(0), // Fetch the first 20 records + ] +});
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
src/routes/blog/post/appwrite-realtime-for-flutter/+page.markdoc(12 hunks)src/routes/blog/post/build-personal-crm-sveltekit/+page.markdoc(5 hunks)src/routes/blog/post/ci-cd-examples-in-appwrite/+page.markdoc(5 hunks)src/routes/blog/post/how-to-build-a-remote-tech-stack/+page.markdoc(6 hunks)src/routes/blog/post/how-to-optimize-your-appwrite-project/+page.markdoc(4 hunks)src/routes/blog/post/improve-devex-dev-keys/+page.markdoc(5 hunks)src/routes/blog/post/open-source-firebase-alternative/+page.markdoc(1 hunks)src/routes/blog/post/open-source-vercel-alternative/+page.markdoc(2 hunks)src/routes/blog/post/serverless-functions-best-practices/+page.markdoc(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
- src/routes/blog/post/ci-cd-examples-in-appwrite/+page.markdoc
- src/routes/blog/post/open-source-vercel-alternative/+page.markdoc
- src/routes/blog/post/open-source-firebase-alternative/+page.markdoc
- src/routes/blog/post/how-to-build-a-remote-tech-stack/+page.markdoc
🧰 Additional context used
🧠 Learnings (7)
📓 Common learnings
Learnt from: ebenezerdon
Repo: appwrite/website PR: 2372
File: src/routes/docs/tutorials/react/step-6/+page.markdoc:70-75
Timestamp: 2025-09-05T19:35:53.943Z
Learning: In React tutorial files, the correct Appwrite database instance to import is `tablesDB` from "../appwrite", not `databases`. The import statement should be `import { tablesDB } from "../appwrite"` to match the usage throughout the React tutorial code.
Learnt from: ebenezerdon
Repo: appwrite/website PR: 2372
File: src/routes/docs/tutorials/react-native/step-6/+page.markdoc:67-73
Timestamp: 2025-09-05T19:35:59.449Z
Learning: In React Native tutorials, the lib/appwrite.js file exports `tablesDB` (not `databases`), so imports should use `import { tablesDB } from "../lib/appwrite"` to match the export pattern established in step-3.
Learnt from: ebenezerdon
Repo: appwrite/website PR: 2372
File: src/routes/docs/tutorials/react-native/step-6/+page.markdoc:67-73
Timestamp: 2025-09-05T19:35:59.449Z
Learning: In React Native tutorials, the lib/appwrite.js file exports `tablesDB` (not `databases`), so imports should use `import { tablesDB } from "../lib/appwrite"` to match the export pattern established in step-3.
Learnt from: ebenezerdon
Repo: appwrite/website PR: 2372
File: src/routes/docs/tutorials/nuxt/step-6/+page.markdoc:79-83
Timestamp: 2025-09-05T19:35:04.162Z
Learning: In Nuxt tutorial files, the correct Appwrite database instance to use is `tablesDB` (imported from "~/appwrite"), not `database`. All tablesDB method calls should use the object parameter format: listRows({ databaseId, tableId, queries }), createRow({ databaseId, tableId, rowId, data }), and deleteRow({ databaseId, tableId, rowId }).
📚 Learning: 2025-09-05T19:35:04.162Z
Learnt from: ebenezerdon
Repo: appwrite/website PR: 2372
File: src/routes/docs/tutorials/nuxt/step-6/+page.markdoc:79-83
Timestamp: 2025-09-05T19:35:04.162Z
Learning: In Nuxt tutorial files, the correct Appwrite database instance to use is `tablesDB` (imported from "~/appwrite"), not `database`. All tablesDB method calls should use the object parameter format: listRows({ databaseId, tableId, queries }), createRow({ databaseId, tableId, rowId, data }), and deleteRow({ databaseId, tableId, rowId }).
Applied to files:
src/routes/blog/post/improve-devex-dev-keys/+page.markdocsrc/routes/blog/post/how-to-optimize-your-appwrite-project/+page.markdocsrc/routes/blog/post/build-personal-crm-sveltekit/+page.markdocsrc/routes/blog/post/appwrite-realtime-for-flutter/+page.markdoc
📚 Learning: 2025-09-05T19:35:53.943Z
Learnt from: ebenezerdon
Repo: appwrite/website PR: 2372
File: src/routes/docs/tutorials/react/step-6/+page.markdoc:70-75
Timestamp: 2025-09-05T19:35:53.943Z
Learning: In React tutorial files, the correct Appwrite database instance to import is `tablesDB` from "../appwrite", not `databases`. The import statement should be `import { tablesDB } from "../appwrite"` to match the usage throughout the React tutorial code.
Applied to files:
src/routes/blog/post/improve-devex-dev-keys/+page.markdocsrc/routes/blog/post/how-to-optimize-your-appwrite-project/+page.markdocsrc/routes/blog/post/build-personal-crm-sveltekit/+page.markdocsrc/routes/blog/post/appwrite-realtime-for-flutter/+page.markdoc
📚 Learning: 2025-09-05T19:35:59.449Z
Learnt from: ebenezerdon
Repo: appwrite/website PR: 2372
File: src/routes/docs/tutorials/react-native/step-6/+page.markdoc:67-73
Timestamp: 2025-09-05T19:35:59.449Z
Learning: In React Native tutorials, the lib/appwrite.js file exports `tablesDB` (not `databases`), so imports should use `import { tablesDB } from "../lib/appwrite"` to match the export pattern established in step-3.
Applied to files:
src/routes/blog/post/improve-devex-dev-keys/+page.markdocsrc/routes/blog/post/how-to-optimize-your-appwrite-project/+page.markdocsrc/routes/blog/post/build-personal-crm-sveltekit/+page.markdocsrc/routes/blog/post/appwrite-realtime-for-flutter/+page.markdoc
📚 Learning: 2025-10-24T22:17:14.669Z
Learnt from: stnguyen90
Repo: appwrite/website PR: 2520
File: src/routes/docs/advanced/self-hosting/production/updates/+page.markdoc:13-15
Timestamp: 2025-10-24T22:17:14.669Z
Learning: In Appwrite versioning, RC (Release Candidate) versions like `1.6.2-RC1` come before the stable release `1.6.2`. Documentation should recommend upgrading to stable versions, not RC versions.
Applied to files:
src/routes/blog/post/improve-devex-dev-keys/+page.markdoc
📚 Learning: 2025-09-25T05:26:19.287Z
Learnt from: BretRen
Repo: appwrite/website PR: 2442
File: src/routes/docs/products/auth/email-password/+page.markdoc:22-31
Timestamp: 2025-09-25T05:26:19.287Z
Learning: Appwrite JavaScript SDKs now support object-based arguments instead of positional arguments as of 2025. The account.create method should be called with an object parameter containing userId, email, password, and optional name, rather than positional arguments. Positional arguments still work but are deprecated.
Applied to files:
src/routes/blog/post/improve-devex-dev-keys/+page.markdoc
📚 Learning: 2025-09-25T05:24:12.551Z
Learnt from: BretRen
Repo: appwrite/website PR: 2442
File: src/routes/docs/products/auth/email-password/+page.markdoc:50-56
Timestamp: 2025-09-25T05:24:12.551Z
Learning: Appwrite v17+ uses object parameters consistently across Account methods. Both account.create({ userId, email, password }) and account.createEmailPasswordSession({ email, password }) use object parameters instead of positional arguments.
Applied to files:
src/routes/blog/post/improve-devex-dev-keys/+page.markdoc
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: assets
- GitHub Check: build
- GitHub Check: tests
🔇 Additional comments (16)
src/routes/blog/post/improve-devex-dev-keys/+page.markdoc (5)
26-26: LGTM! Terminology correctly updated.The migration from "document" to "row" is consistent with the TablesDB API changes.
32-36: LGTM! Table setup and terminology correctly migrated.The column definition and permissions setup now correctly reference "table" instead of "collection", consistent with TablesDB.
60-61: LGTM! User-facing text correctly updated.Button label and description now correctly use "rows" terminology, matching the TablesDB API migration.
79-79: LGTM! TablesDB instantiation is correct.The migration from
Appwrite.DatabasestoAppwrite.TablesDBwith thetablesDBvariable name follows the correct pattern.
117-117: LGTM! Button reference correctly updated.The button text reference now correctly uses "rows" terminology, consistent with the TablesDB migration throughout the document.
src/routes/blog/post/serverless-functions-best-practices/+page.markdoc (4)
98-98: LGTM!The text clarification improves readability and clearly explains the impact of cold starts on user experience.
102-104: Excellent additions to performance guidance!The new content about warm-up strategies and resource reuse provides valuable optimization techniques while appropriately warning readers about potential trade-offs (costs, abuse, stale data). This balanced guidance will help readers make informed decisions.
140-142: Great addition to the authorization section!This new content about configuring execute access provides valuable security guidance that complements the existing authorization information. It helps readers understand how to control function execution at the API level.
136-136: No terminology update needed for "Appwrite Databases".The phrase "Appwrite Databases and Storage services" correctly uses the product service names. The terminology updates in line 136 are accurate:
- "documents" → "rows" ✓
- "collection" → "table" ✓
- "Appwrite Databases" (service name) remains correct ✓
"Appwrite Databases" refers to the service/product name, while "TablesDB" is the new UI/API interface. The data structure terminology has been properly updated (rows, tables, columns), and the service reference is appropriately distinct. No changes are required.
src/routes/blog/post/build-personal-crm-sveltekit/+page.markdoc (2)
85-93: LGTM! Correct TablesDB import and instantiation.The migration from Databases to TablesDB is correctly implemented with proper imports and client instantiation.
164-214: LGTM! API route correctly uses wrapper functions.The API route implementation properly uses the exported database wrapper functions and correctly accesses the
rowsproperty from responses, aligning with the TablesDB migration.src/routes/blog/post/appwrite-realtime-for-flutter/+page.markdoc (5)
31-48: LGTM! UI terminology properly updated.The setup instructions correctly use the new terminology: "Create table", "Columns tab", "Table ID", and "Column Key". All references are consistent with the TablesDB model.
203-230: LGTM! TablesDB initialization and API usage are correct.The code properly migrates to the new Tables API:
- Uses
TablesDBclass- Calls
listRows()with correct named parameters- References
res.rowsinstead ofres.documentsAll syntax is appropriate for Flutter/Dart.
264-294: LGTM! CRUD operations properly migrated.The code correctly uses:
createRow()withtableIdandrowIdparametersdeleteRow()withtableIdandrowIdparametersAll method signatures and parameter names align with the new Tables API.
298-463: LGTM! Complete example is consistent and correct.The full example properly demonstrates the TablesDB migration:
- Consistent use of
TablesDB,itemsTablevariable naming- All CRUD operations (
listRows,createRow,deleteRow) use correct method names and parameters- Response handling uses
res.rowscorrectly- The code provides a complete, working reference for readers
235-259: Code is correct; consider adding context about production channel patterns.The
'rows'channel syntax is confirmed correct. The genericrowschannel subscribes to all rows across all databases and tables, and your code comment accurately reflects this behavior.For a tutorial, this broad subscription is appropriate for simplicity. However, consider adding a note that production applications would typically use specific channels like
databases.<DATABASE_ID>.tables.<TABLE_ID>.rowsfor efficiency and to receive only relevant events.
| async function deleteRows() { | ||
| try { | ||
| return await databases.deleteDocuments({ | ||
| databaseId, | ||
| collectionId, | ||
| }); | ||
| return await tablesDB.deleteRows(databaseId, tableId, []); | ||
| } catch (error) { | ||
| console.error('Error deleting documents:', error); | ||
| throw new Error('Failed to delete documents'); | ||
| console.error('Error deleting rows:', error); | ||
| throw new Error('Failed to delete rows'); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
Use object-parameter signature for deleteRows.
Based on learnings and the TablesDB API pattern, deleteRows should use an object parameter instead of positional arguments.
Apply this diff:
async function deleteRows() {
try {
- return await tablesDB.deleteRows(databaseId, tableId, []);
+ return await tablesDB.deleteRows({ databaseId, tableId, rowIds: [] });
} catch (error) {
console.error('Error deleting rows:', error);
throw new Error('Failed to delete rows');
}
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| async function deleteRows() { | |
| try { | |
| return await databases.deleteDocuments({ | |
| databaseId, | |
| collectionId, | |
| }); | |
| return await tablesDB.deleteRows(databaseId, tableId, []); | |
| } catch (error) { | |
| console.error('Error deleting documents:', error); | |
| throw new Error('Failed to delete documents'); | |
| console.error('Error deleting rows:', error); | |
| throw new Error('Failed to delete rows'); | |
| } | |
| async function deleteRows() { | |
| try { | |
| return await tablesDB.deleteRows({ databaseId, tableId, rowIds: [] }); | |
| } catch (error) { | |
| console.error('Error deleting rows:', error); | |
| throw new Error('Failed to delete rows'); | |
| } | |
| } |
🤖 Prompt for AI Agents
In src/routes/blog/post/build-personal-crm-sveltekit/+page.markdoc around lines
126 to 132, the call to tablesDB.deleteRows uses positional arguments but the
TablesDB API expects a single object parameter; change the call to pass an
object like tablesDB.deleteRows({ databaseId, tableId, rowIds: [] }) (or the
correct key name for the IDs if different), keep the try/catch and error
handling as-is.

What does this PR do?
Updates terminogies to to reflect new API/UI
Related PRs and Issues
Summary by CodeRabbit
Documentation
Style